#ifndef INFORMATIONVIEW_H
#define INFORMATIONVIEW_H

#include <QWidget>
#include <QPushButton>
#include <QMouseEvent>
#include <QLabel>
#include <QVBoxLayout>
#include "view_global.h"
#include "NewLineEdit.h"

/**
 * @brief 暂停原因选择对话框
 * 
 * 提供多种预设的暂停原因选项，也支持自定义输入
 */
class VIEW_EXPORT InformationView : public QWidget
{
    Q_OBJECT
    
public:
    /**
     * @brief 暂停原因类型枚举
     */
    enum ReasonType {
        Information,    // 信息
        Disturb,        // 打扰
        Rest,           // 休息
        Washroom,       // 洗手间
        Custom          // 自定义
    };
    Q_ENUM(ReasonType)
    
public:
    explicit InformationView(QWidget *parent = nullptr);
    virtual ~InformationView();
    
    // 设置窗口尺寸
    void setWindowSize(int width, int height);
    
signals:
    /**
     * @brief 当用户选择暂停原因时发出
     * @param type 原因类型
     * @param reason 原因文本
     */
    void reasonSelected(ReasonType type, const QString& reason);
    
private:
    void initForm();
    void initData();
    void initializeLayout();
    void applyStyles();
    
    // 创建带图标的按钮
    QPushButton* createIconButton(const QString& iconPath, const QString& text);
    
private slots:
    void onBtnInfoClicked();
    void onBtnDisturbClicked();
    void onBtnRestClicked();
    void onBtnWashroomClicked();
    void onBtnCustomClicked();
    void onEditCustomConfirm();
    
protected:
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void showEvent(QShowEvent *event) override;
    
private:
    // UI 组件
    QWidget* mainWidget;
    QLabel* titleLabel;
    QPushButton *infoButton;
    QPushButton *disturbButton;
    QPushButton *restButton;
    QPushButton *washroomButton;
    QPushButton *customButton;
    NewLineEdit* customEdit;
    
    // 拖动相关
    bool isDragging;
    QPoint mouse_startPoint;
    QPoint window_top_left_point;
    
    // 窗口尺寸
    int m_nWidth;
    int m_nHeight;
};

#endif // INFORMATIONVIEW_H
